﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="statdata.aspx.cs" Inherits="custom_pages_statdata" %>
{
    "cols": [
            <%
                for (int i = 0; i < cols.Count; i++) {
                    string[] headers = cols[i];
                    Response.Write("{\"label\": \"" + headers[0] + "\", " +
                        "\"type\": \"" + headers[1] + "\"}");
                    if (i != cols.Count - 1) Response.Write(", ");
                }
                %>
            ],
    "rows": [
            <%
                for (int i = 0; i < rows.Count; i++) {
                    object[] cells = rows[i];
                    Response.Write("{\"c\":[");
                    for (int j = 0; j < cells.Length; j++) {
                        if (cells[j].GetType().Equals(typeof(double)))
                            Response.Write("{\"v\": " + cells[j] + "}");
                        else
                            Response.Write("{\"v\": \"" + cells[j] + "\"}");
                        if (j != cells.Length - 1) Response.Write(", ");
                    }
                    Response.Write("]}");
                    if (i != rows.Count - 1) Response.Write(", ");
                }
                %>
            ]
}